<template>
  <transition name="fade">
    <div v-if="isLoading" class="loading-overlay">
      <div class="loading-spinner"></div>
    </div>
  </transition>
</template>

<script>
export default {
  props: {
    isLoading: Boolean,
  },
};
</script>

<style scoped>
.loading-overlay {
  position: fixed;
  top: 60px;
  left: 200px;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  position: absolute;
  border: 4px solid #3498db;
  border-radius: 50%;
  border-top: 4px solid #f3f3f3;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.5s;
}

.fade-enter, .fade-leave-to {
  opacity: 0;
}
</style>
